package de.luisoft.web.servlet;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.datastore.Entity;

import de.luisoft.dao.MyDAO;

public class DeleteExpiredSessionServlet extends HttpServlet {

	private static final Logger log = Logger.getLogger(DeleteExpiredSessionServlet.class.getName());
	/**
	 * 
	 */
	private static final long serialVersionUID = 7161146165061872986L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		log.info("doGet");
		
		resp.setContentType("text/plain");
		
		int nr = new MyDAO().deleteExpiredSessions();

		resp.getWriter().append("deleted=" + nr);
		resp.getWriter().close();
	}

}
